<?php
	include('config/config.php');
	include('config/funcs.php');
	global $CONFIG;
// connect to the database
	$link = mysql_connect($CONFIG['dbserver'], $CONFIG['dbuser'], $CONFIG['dbpass']);

/* check database connection */
	if (!$link) {
		           die('Not connected : ' . mysql_error());
	}

	$delUser = $_GET['delUser'];
	if ($deluser != "root")
	{
		$dbQuery="DELETE FROM mysql.user WHERE User=\"".$delUser."\"";
	}
	

	$result = mysql_query($dbQuery) or die('dbquery failed: '.mysql_error().' <br /><a href="index.php">Back</a>');
	
	if (!$result) {
			echo "Somethin aint right, Jimbo! ".mysql_error();
			echo "<a href='index.php'>Back</a>";
	}
	else {
			echo "YAY! User DROPPED!";
			echo "<a href='http://localhost/koodb/index.php'>Back</a>";
	}

